package com.taotrade.nexus.admin.service;

import com.crt.nexus.core.constant.SecurityConstants;
import com.crt.nexus.core.response.R;
import com.crt.nexus.domain.dtos.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "crt-user", contextId = "userRemoteService", url = "http://localhost:9020")
public interface UserRemoteService {

    @GetMapping("/feign/users/{username}")
    R<UserDto> getUser(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);

}
